package org.hitchhike.core.exception;

import lombok.Data;
import lombok.EqualsAndHashCode;

@Data
@EqualsAndHashCode(callSuper = false)
public class ErrorInfo<T> {

  public static final Integer OK = 0;

  public static final Integer ERROR = 100;

  public static final String MESSAGE_OK = "操作成功";

  public static final String MESSAGE_ERROR = "操作失败";

  private Integer code;

  private String message;

  private String url;

  private T data;

  public ErrorInfo() {}

  public ErrorInfo(String url) {
    this.code = OK;
    this.url = url;
  }

  public ErrorInfo(T data, String url) {
    this.code = OK;
    this.url = url;
    this.data = data;
  }

}
